<template>
  <el-card class="box-card">

    <el-row type="flex" justify="space-between" align="middle">
      <el-col>
        <slot name="btTitle" />
      </el-col>

      <el-row type="flex" justify="end">
        <slot name="isSelect" />
        <el-input v-model="searchData" placeholder="请输入搜索内容" style="width:400px" @keyup.enter.native="MoSearch" /><el-button @click="MoSearch">筛选</el-button>
      </el-row>

    </el-row>
    <slot name="tableBody" />
  </el-card>
</template>

<script>
import { searchPagesList } from '@/api/pages/index'
export default {
  data() {
    return {
      searchData: '', // 输入框的值
      moTotal: 0, // 模糊搜索返回总数
      moTotalProperties: ''
    }
  },
  methods: {
    async MoSearch() {
      const str = `?title_contains=${this.searchData}`
      const res = await searchPagesList(str)
      this.moTotal = res.data
      this.$emit('mo-search', this.moTotal)
      this.$emit('properties-search')
    }
  }
}
</script>

<style lang="scss" scoped>
</style>
